package br.edu.fanor.geract.entity;

import java.io.Serializable;
import java.sql.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

@Entity
@Table(name="Resumos")
public class Resumos implements Serializable{

	private static final long serialVersionUID = 5961428209915912146L;	
	@Id
	@SequenceGenerator(name="SeqResumos", sequenceName="SeqResumos", allocationSize=1)
	@GeneratedValue(generator="SeqResumos", strategy=GenerationType.SEQUENCE)
	@Column(name="IdResumo")
	private Long id;
	
	@NotNull
	@Column(name="Assunto")
	private String assunto;
	
	@NotNull
	@Column(name="DataCriacao")
	private Date dataCriacao;
	
	@NotNull
	@Column(name="UltimaEdicao")
	private Date dataUltimaEdicao;
	
	@Column(name="Resumo")
	private StringBuffer resumo;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getAssunto() {
		return assunto;
	}

	public void setAssunto(String assunto) {
		this.assunto = assunto;
	}

	public Date getDataCriacao() {
		return dataCriacao;
	}

	public void setDataCriacao(Date dataCriacao) {
		this.dataCriacao = dataCriacao;
	}

	public Date getDataUltimaEdicao() {
		return dataUltimaEdicao;
	}

	public void setDataUltimaEdicao(Date dataUltimaEdicao) {
		this.dataUltimaEdicao = dataUltimaEdicao;
	}

	public StringBuffer getResumo() {
		return resumo;
	}

	public void setResumo(StringBuffer resumo) {
		this.resumo = resumo;
	}

	@Override
	public String toString() {
		return "Resumos [id=" + id + ", assunto=" + assunto + ", dataCriacao="
				+ dataCriacao + ", dataUltimaEdicao=" + dataUltimaEdicao
				+ ", resumo=" + resumo + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Resumos other = (Resumos) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}
	
		
}